package com.mq.direct;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ytj
 * @date 2024/1/11
 */
@Component
@RabbitListener(queues = Demo1Message.QUEUE_NAME)
public class Demo1Consumer {

    @RabbitHandler
    public void onMessage(Demo1Message message){
        System.out.println("获取mq消息为:"+message.getMessage()+",时间为:"+message.getId());
    }
}
